
package com.idealighter.game.games.shuihu.handler;

import com.idealighter.game.core.annotation.ResMsgHandler;
import com.idealighter.game.games.shuihu.message.ReqBillMsg;
import com.idealighter.game.message.ModuleMsgIdConstant;
import com.idealighter.game.message.core.ResMessage;
import com.idealighter.game.robot.core.Player;
import com.idealighter.game.robot.handler.ResMessageHandler;
import com.idealighter.utils.code.RandCodeUtil;

import java.util.concurrent.TimeUnit;


@ResMsgHandler(ModuleMsgIdConstant.ShuiHu.SHUI_HU_START)
public class ResShuiHuStartHandler implements ResMessageHandler {

  @Override
  public void action(Player player, ResMessage message) {
    // ResShuiHuStartMsg msg = (ResShuiHuStartMsg) message;
    // 延迟2或者3秒结算
    player.schedule(() -> player.sendMsg(new ReqBillMsg()), RandCodeUtil.random(2, 3),
        TimeUnit.SECONDS);

  }
}
